package com.kk.lesson04;

import javax.swing.*;
import java.awt.*;

public class JFrameDemmo2 {
    public static void main(String[] args) {
        new MyJFrame2().init();
    }
}
class MyJFrame2 extends JFrame{
    public void init()
    {
        this.setBounds(200,200,800,400);
        this.setVisible(true);
        //设置文字
        JLabel label = new JLabel("欢迎使用本软件");
        label.setHorizontalAlignment(SwingConstants.CENTER);
        this.add(label);
        Container contentPane = this.getContentPane();
        contentPane.setBackground(Color.blue);
    }
}